<?php
// $Id: node.tpl.php,v 1.5 2007/10/11 09:51:29 goba Exp $
?>
<div id="node-<?php print $node->nid; ?>" class="node<?php if ($sticky) { print ' sticky'; } ?><?php if (!$status) { print ' node-unpublished'; } ?>">
<?php global $user,$base_url;?>
<?php 
/*echo "<pre>";
print_r($node);
echo "</pre>"
*/
 $st = $node->created;
 $en = strtotime(date("d-m-Y h:i:s"))+43200;//adding 12 hours to current time
 $diff = round(($en - $st)/(3600*24)); 
 $days =$diff." days ago";
if(!$diff)
{
$diff = round(($en - $st)/(3600));
$days ="about ".$diff." hours ago";
/*if(!$diff)
{
 $diff = round(($en - $st)/(360));
 $days =$diff." Minutes ago";
}*/

}

//echo date('d',$node->created);
?>
<?php print $picture ?>
<?php if ($page == 0): ?>
  
<?php endif; ?>


   <div class="content clear-block">
   <div class="question_area"><!-- question area div start here -->
        <div class="left_area_image"><?php 
$profile_node = content_profile_load('profile', $node->uid);
/*echo "<pre>";
 print_r($profile_node);
 echo "</pre>";*/
 if($profile_node->field_upload_image[0]['fid'] != ""){
  $p = $profile_node->field_upload_image[0]['filepath'];
 
  print theme('imagecache', 'forum_icon', $p, '', '', array('align'=>'left','style'=>'padding:5px'));
 } else {
    $gender = $profile_node->field_gender[0]['value'];
   if($gender == 'Male'){
	   $src=$base_url."/".path_to_theme()."/images/male_icon.gif";
   	   echo '<img src="'.$src.'" align="left"  />';
   } else {
	   	   $src=$base_url."/".path_to_theme()."/images/female_icon.gif";
	   	   echo '<img src="'.$src.'" align="left" />';
   }
   }
?></div>
        <div class="right_area_content"> <!-- right area content div Start here -->
            <p class="questions" style="float:left;"><span class="blue2"><?php $profile_node = content_profile_load('profile', $node->uid);print $profile_node->field_first_name['0']['value']; ?> </span>asked a question in <span class="blue2">@ (SMS vidya) Questions:&nbsp;
			</span><?php print $content ?></p>

              <!-- show button-->
            <p class="answer_btn_show" id="node<?php echo $node->nid;?>">
			<?php if($node->uid != $user->uid) {?>
			
			 Answer 
			<?php } else {
			print '&nbsp;&nbsp;'.l('Edit','node/'.$node->nid.'/edit',array('attributes'=>array('class'=>'popups'),'html'=>'TRUE'));	
			}
			if ($submitted): ?>
                   <span class="submitted" style="float:left; padding-right:10px;"><?php print $days; ?> </span>
                 <?php endif; ?>
             </p>
<!-- hide button -->
       
        </div><!-- right area content div end here -->
    </div><!-- question area div End here -->
  </div>

  <div class="clear-block">
  

    <?php if ($links): ?>
      <div class="links"><?php print $links; ?></div>
    <?php endif; ?>
  </div>

</div>
